$(function () {
    var $user = $("#i-username"),
        $pwd = $("#i-password"),
        $login = $("#i-login-btn");
    $login.click(function () {
       var userVal = $user.val(),
           pwdVal = $pwd.val();
        $(".t-loading-word").html('登陆中');
       $(".t-loading").show();
       $.post("/index.php/auth/login",{
           "username" : userVal,
           "password" : pwdVal
       },function (data) {
           setTimeout(function () {
               if(data.res==1){
                   var _url='/';
                   $(".t-loading").hide();
                   location.href = '/';
               }else{
                   $(".t-loading").hide();
                   dialog.error(data.info)
               }
           },1000);
       });
    });
})
